//
//  CelloneTab2.m
//  project-A (pianke)
//
//  Created by dllo on 16/1/26.
//  Copyright © 2016年 scott. All rights reserved.
//

#import "CelloneTab2.h"
#import <DKNightVersion.h>

@implementation CelloneTab2

-(void)dealloc{
    [_labelby release];
    [_labelcount release];
    [_labellei release];
    [_labelneirong release];
    [_button release];
    [_zan release];
    [_image release];
   
    [super dealloc];
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creattabView];
    }
    return self;
}

-(void)creattabView{
    self.image = [[UIImageView alloc]init];
    [self.contentView addSubview:self.image];
    
    [self.image release];
    
    self.zan = [[UIImageView alloc]init];
    self.zan.image = [UIImage imageNamed:@"xin"];
    [self.contentView addSubview:self.zan];
        [self.zan release];
    
    self.button = [UIButton buttonWithType:UIButtonTypeSystem];
    [self.button setImage:[UIImage imageNamed:@"start"] forState:UIControlStateNormal];
    [self.contentView addSubview:self.button];
    [self.button addTarget:self action:@selector(button) forControlEvents:UIControlEventTouchUpInside];
   
    
    
    self.labelby = [[UILabel alloc]init];
    
    [self.contentView addSubview:self.labelby];
    
    self.labelby.dk_textColorPicker = DKColorWithColors([UIColor blackColor], [UIColor whiteColor]);
    
    [self.labelby release];
    
    self.labelcount = [[UILabel alloc]init];
  
     self.labelcount.dk_textColorPicker = DKColorWithColors([UIColor blackColor], [UIColor whiteColor]);
    [self.contentView addSubview:self.labelcount];
    [self.labelcount release];
    
    self.labellei = [[UILabel alloc]init];
       [self.contentView addSubview:self.labellei];
     self.labellei.dk_textColorPicker = DKColorWithColors([UIColor blackColor], [UIColor whiteColor]);
    [self.labellei release];
    
   
    
    self.labelneirong = [[UILabel alloc]init];
    [self.contentView addSubview:self.labelneirong];
    
     self.labelneirong.dk_textColorPicker = DKColorWithColors([UIColor blackColor], [UIColor whiteColor]);
    [self.labelneirong release];
    
    
    
}
-(void)layoutSubviews{
    CGFloat width = self.contentView.frame.size.width;
//    CGFloat height = self.contentView.frame.size.height;
    self.labellei.frame =CGRectMake(20,20, width - 40, 15);
    

    self.image.frame = CGRectMake(80, 50, width - 160, (width -160) * 0.618);
    
    self.button.frame = CGRectMake(0, 0, 40, 40);
    
    self.button.center = CGPointMake(width / 2.0f, 50 + (width -160) * 0.618);
    self.labelneirong.frame = CGRectMake(100,75 + (width -160) * 0.618, width - 200, 25);
    self.labelby.frame = CGRectMake(100, 110 + (width -160) * 0.618, width - 200, 15);
    
    self.zan.frame = CGRectMake(width - 100, 150 + (width -160) * 0.618, 20, 20);
    
    self.labelcount.frame = CGRectMake(width - 70,  150 + (width -160) * 0.618, 40, 20);
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
